package com.seckill.dto;

import com.seckill.entity.Success;
import com.seckill.util.SeckillStatusEnum;

/**
 * @Creation_time 2017/9/7
 * @Theme 用来封装秒杀执行后的结果dto
 * @Autor Xiao Yiyun
 */
public class SeckillExecution {

    //标识是哪个秒杀单
    private int seckillId;
    //标识秒杀执行结果状态
    private int status;
    //状态表示
    private String statusInfo;
    //秒杀成功对象
    private Success success;

    public SeckillExecution(int seckillId, SeckillStatusEnum seckillStatusEnum, Success success) {
        this.seckillId = seckillId;
        this.status = seckillStatusEnum.getStatus();
        this.statusInfo = seckillStatusEnum.getStatusInfo();
        this.success = success;
    }

    public SeckillExecution(int seckillId, SeckillStatusEnum seckillStatusEnum) {
        this.seckillId = seckillId;
        this.status = seckillStatusEnum.getStatus();
        this.statusInfo = seckillStatusEnum.getStatusInfo();
    }

    public int getSeckillId() {
        return seckillId;
    }

    public void setSeckillId(int seckillId) {
        this.seckillId = seckillId;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getStatusInfo() {
        return statusInfo;
    }

    public void setStatusInfo(String statusInfo) {
        this.statusInfo = statusInfo;
    }

    public Success getSuccess() {
        return success;
    }

    public void setSuccess(Success success) {
        this.success = success;
    }

    @Override
    public String toString() {
        return "SeckillExecution{" +
                "seckillId=" + seckillId +
                ", status=" + status +
                ", statusInfo='" + statusInfo + '\'' +
                ", success=" + success +
                '}';
    }
}
